package org.ucas.faker.web.utils.model;


import java.util.ArrayList;
import java.util.List;

public class TreeTerm {

    private String word_CN;
    private String word_EN;

    private long id;
    private List<TreeTerm> childTermList = new ArrayList<TreeTerm>();

    public TreeTerm(String word_CN){
        this.word_CN = word_CN;
        this.word_EN = "";
        this.id =  System.currentTimeMillis();
        this.childTermList = new ArrayList<TreeTerm>();
    }

    public TreeTerm(String word_CN, String word_EN){
        this.word_CN = word_CN;
        this.word_EN = word_EN;
        this.id =  System.currentTimeMillis();
        this.childTermList = new ArrayList<TreeTerm>();
    }

    public TreeTerm addChildTerm(String word_CN, String word_EN){
        TreeTerm term = new TreeTerm(word_CN, word_EN);
        this.childTermList.add(term);
        return this;
    }

    public TreeTerm addChildTerm(TreeTerm term){
        this.childTermList.add(term);
        return this;
    }

    public TreeTerm addChildTerm(String word_CN){
        TreeTerm term = new TreeTerm(word_CN);
        this.childTermList.add(term);
        return this;
    }

    public TreeTerm setId(long id) {
        this.id = id;
        return this;
    }

    public long getId() {
        return id;
    }

    public TreeTerm setChildTermList(List<TreeTerm> childTermList) {
        this.childTermList = childTermList;
        return this;
    }

    public List<TreeTerm> getChildTermList() {
        return childTermList;
    }

    public TreeTerm setWord_CN(String word_CN) {
        this.word_CN = word_CN;
        return this;
    }

    public String getWord_CN() {
        return word_CN;
    }

    public TreeTerm setWord_EN(String word_EN) {
        this.word_EN = word_EN;
        return this;
    }

    public String getWord_EN() {
        return word_EN;
    }

    public int getChildrenNum(){
        return this.childTermList.size();
    }
}
